# -------------------在jenkins容器里执行--------------------------
git checkout master
git pull
#!/bin/bash

echo $PATH
cd ${WORKSPACE}/xingchen-admin-vue


npm install
npm run build

#将构建好的dist项目，移到/opt/data/vue目录
rm -rf /opt/data/vue
mkdir -p /opt/data/vue
chmod 777 /var/jenkins_home/workspace/vue-admin/xingchen-admin-vue/dist
chmod 777 /opt/data/vue
mv /var/jenkins_home/workspace/vue-admin/xingchen-admin-vue/dist /opt/data/vue

#复制文件
cp -Rf /var/jenkins_home/workspace/vue-admin/xingchen-admin-vue/Dockerfile /opt/data/vue
cp -Rf /var/jenkins_home/workspace/vue-admin/xingchen-admin-vue/nginx.conf /opt/data/vue
cp -Rf /var/jenkins_home/workspace/vue-admin/xingchen-admin-vue/conf.d /opt/data/vue
cp -Rf /var/jenkins_home/workspace/vue-admin/xingchen-admin-vue/sources.list /opt/data/vue
cp -Rf /var/jenkins_home/workspace/vue-admin/xingchen-admin-vue/jenkin_vue-admin.sh /opt/data/vue
cp -Rf /var/jenkins_home/workspace/vue-admin/xingchen-admin-vue/jenkin_vue-adminAfter.sh /opt/data/vue
